home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ May 89 / U0016-Re Changing Field-May89 < prev    next >
Encoding:
Text File  |  1989-06-26  |  1.4 KB  |  48 lines  |  [TEXT/GEOL]

  1. Item    5614659                         6-May-89        05:57
  2.  
  3. From:   X0591                           MacApp Dev Assoc, Howard Katz
  4.  
  5. To:     CDA0373                         AUC Lakehead University
  6.  
  7. cc:     MACAPP.TECH$                    MACAPP Tech
  8.  
  9. Sub:    Response to Changing Field
  10.  
  11. Alan,
  12.  
  13.     I’ve never heard of a mechanism like that.  The closest you can come is
  14. adding your more specialized field name YOURSELF and doing an assignment to it
  15. in your new Init method, as in:
  16.  
  17.     TMyObject = Object( whatever )
  18.  
  19.         fMyField : FieldType;
  20.  
  21.         TMyObject.IMyObject ( fieldVal: FieldType );
  22.  
  23.         ...
  24.  
  25.     TMySpecializedObject = Object( TMyObject )
  26.  
  27.         fMySpecializedField: FieldType;
  28.  
  29.         PROCEDURE TMySpecializedObject.IMySpecializedObject(
  30.                                                     fieldVal: FieldType )
  31.         BEGIN
  32.             fMySpecializedField := fieldVal;
  33.             fMyField := fieldVal;
  34.             { or even better => } IMyObject( fieldVal );
  35.         END;
  36.  
  37.     But then you have TWO of everything, and a great potential for disaster!
  38. Plus of course any code you’re inheriting is going to use fMyField and
  39. not fMySpecializedField.  Doesn’t sound like a good idea!  It confuses more
  40. than it clarifies.
  41.  
  42.     (By the way, a “netiquette” suggestion: sign your links so that people can
  43. know who they’re talking to - it’s hard to say “Dear AUC Lakehead
  44. University...”!)
  45.  
  46. Howard
  47.  
  48.